#include <iostream>
#include <memory>
#include <thread>
using namespace std;
class A
{
private:
    int number;
public:
    A() { cout << "A()" << endl; }
    ~A() { cout << "~A()" << endl; }
    void funA()
    {
        cout << "A is good method!"<<number << endl;
    }
};
void hander01(A *p)
{
    std::this_thread::sleep_for(std::chrono::seconds(2));
    p->funA();
}
int main()
{
    A *p = new A();
    thread t1(hander01,p);
    delete p;
    t1.join();
}

